package com.ljf.eslab.lab.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ljf.eslab.lab.dto.ReserInfoDTO;
import com.ljf.eslab.lab.dto.TimeListAndLidsDTO;
import com.ljf.eslab.lab.dto.TimeListDTO;
import com.ljf.eslab.lab.entity.ReservationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ljf.eslab.lab.vo.ReserDetailVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author ljf
 * @email ljf@gmail.com
 * @date 2021-05-28 09:12:59
 */
@Mapper
public interface ReservationDao extends BaseMapper<ReservationEntity> {
	List<ReserInfoDTO> getReserInfoByTime(@Param("timeList")TimeListDTO dto);
	IPage<ReserDetailVo> getReserPageByTime(IPage<ReservationEntity> page, @Param("timeList") TimeListDTO dto);
	IPage<ReserDetailVo> getReserDetailPageByLids(IPage<ReserDetailVo> page, @Param("ids") List<Integer> ids);
	IPage<ReserDetailVo> getReserDetailByCids(IPage<ReservationEntity> page,@Param("cids") List<Integer> cids);
	//TODO 通过时间和课程ids获得分页的预约信息
	IPage<ReserDetailVo> getPageByTimeAndIds(Map<String, Object> params,@Param("dto") TimeListAndLidsDTO timeListAndLidsDTO);

    void updateCidByIds(@Param("ids") List<Integer> ids, @Param("courseId")Integer courseId);

	IPage<ReserDetailVo> getPageByTimeAndLids(IPage<ReserDetailVo> params,@Param("dto") TimeListAndLidsDTO dto);
}
